<?php

declare(strict_types=1);

namespace App\Api\Controller;

use App\Api\Middleware\ResponseMiddleware;
use App\Api\Service\ConfigService;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\HttpServer\Annotation\Middlewares;

#[Controller(prefix: 'api'), Middlewares([ResponseMiddleware::class])]
class ConfigController
{
    /**
     * 获取配置
     * @param ConfigService $service
     * @return array
     */
    #[GetMapping('configs')]
    public function index(ConfigService $service): array
    {
        return $service->index();
    }
}
